<?php
include("../../inc/conn.inc");
include("../islogin2.php");
$urls = "hot_pro.php";
$info = "非法操作!";
$time = time();
$id  = $_COOKIE['user_id'];
if($_GET['fresh']=="all")
{

	$rs = mysql_query("select id from hot_pro_fresh where member_id = $id and create_time>".strtotime('today'));
	$c = mysql_num_rows($rs);

	if($c)
	{
		$info = "您今天已经刷新过全部产品，请明天再试。";
	}
	else
	{
		$sql = "insert into hot_pro_fresh(member_id,create_time) values('$id','$time')";
		mysql_query($sql);
		$sql = "update hot_pro set p_addtime='".date("Y-m-d H:i:s")."'  where member_id='$id'";
		mysql_query($sql);
		$info = "刷新全部产品成功";
	}

}



echo "<script>alert('".$info."');location='".$urls."'</script>";

?>

